<?php
/**
 * 
 */
//echo realpath(__FILE__);
//echo md5('qwerty');

/* VARS
**************************/
$tpl_content = 'body2';
if ($_GET['c'] != '') { $tpl_content = $_GET['c']; }
$file_type = 'php';
$buffer = TRUE;
$tpl_arr = array(
	'head'
	,$tpl_content # центральная часть
	,'footer'
);

$logged = '';
session_start();
//echo session_name();


/*
include_once 'tpl.head.php';
include_once 'tpl.body1.php';
include_once 'tpl.footer.php';
*/


/**
 * подключатель ))
 *
 * @param unknown_type $f_type
 * @param unknown_type $f_name
 */
function includer ($f_type = 'php', $f_name) {
	if (is_array($f_name)) {
		foreach ($f_name as $v) {
			is_file('tpl.'.$v.'.'.$f_type);
			$files_arr[] = $v;  
			include_once 'tpl.'.$v.'.'.$f_type;
		}
	}
	else {
	is_file('tpl.'.$f_name.'.'.$f_type);
	$files_arr[] = $f_name;  
	include_once 'tpl.'.$f_name.'.'.$f_type;
	}
}

/* выбор типа вывода
******************************************/
if ($buffer === TRUE) {
	ob_start();
	includer($file_type , $tpl_arr);
	$fff = ob_get_clean();
	echo $fff;
}
else includer($file_type , $tpl_arr);

?>